package com.xframe.xdal.core.convert.imp.mySql;

import com.xframe.xdal.core.convert.IDBConvertStrategy;
import com.xframe.xdal.core.util.StringUtil;

public class integerToDBType implements IDBConvertStrategy {

    /**
     * @param dataLength 字段长度
     * @param scale      小数位
     * @return
     */
    @Override
    public String getType(Integer dataLength, Integer scale) {
        if (dataLength <= 32  ) {
            dataLength = 32;
        }
        return StringUtil.format("integer({})", dataLength == 0 ? 10 : dataLength);
    }
}
